<template>
  <div class="wrapper">

    <!--<div v-for="(item,index) in listData">-->
      <!--<text>{{item[0]}}</text>-->
    <!--</div>-->
    <keep-alive>
      <router-view/>
    </keep-alive>


    <tab-bar @tabTo="onTabTo"></tab-bar>
  </div>
</template>

<script>
  import TabBar from '@/components/commen/TabBar'
  import Utils from '@/assets/js/utils'
  var model = weex.requireModule('modal')
  var stream = weex.requireModule('stream');
  export default {
    name: 'App',
    components:{TabBar},
    data() {
      return {
        logo: 'https://gw.alicdn.com/tfs/TB1yopEdgoQMeJjy1XaXXcSsFXa-640-302.png',
        //listData: []
      }
    },
    created() {
      // this.test();
      //this.initData();
      console.log()
      Utils.initIconFont();
    },
    methods: {
      onTabTo(val){
        console.log(val);
        this.$router && this.$router.push(val)
      },
      test() {
        model.confirm({
          message: 'Do you confirm ?',
          duration: 0.3
        })
        console.log(12445);
      },
      initData(){
        stream.fetch({
          method: 'GET',
          type: 'jsonp',
          url:'https://suggest.taobao.com/sug?code=utf-8&q=%E5%8D%AB%E8%A1%A3&callback=cb'
        },function (res) {
          console.log(res)
           //this.listData=res.data.result;
        });
      }
      // initData(){
      //   this.$ajax.get('https://suggest.taobao.com/sug?code=utf-8&q=%E5%8D%AB%E8%A1%A3&callback=cb',{},res=>{
      //     console.log(res)
      //     this.listData=res.result
      //   });
      // }
    }

  }
</script>

<style>

</style>
